package com.example.a7822.myapplication.utils;

/**
 * Created by flyln on 2017/10/27 15:02.
 * email:xyf_uestc@163.com
 */

public class CommonUtil {

    public static String  getLimitString(String str , int limit){
        if (str == null) {
            return null;
        }
        if (str.length() > limit) {
            str = str.substring(0, limit - 1) + "...";
        }
        return str;
    }
}
